<template>
  <div>
    <h1>我是根一级组件Vue.js---{{color}}</h1>
    <level-one></level-one>
    <button @click="color='blue'">tagblue</button>
  </div>
</template>

<script>
import { computed } from 'vue'
import LevelOne from './LevelOne.vue'
export default {
    name:'MyApp',
components:{
    LevelOne
},
data(){
    return{
        color:'red'
    }
},
// 向后代的组件传值
provide(){
    // 共享的数据值
    return {//return一个对象值出去
        color:computed(()=>{return this.color}),//响应式传值
        age:12
    }
}
}
</script>

<style>

</style>